/**
 * IsInclude.java created by zhangzhidong 
 * at 下午8:14:37 2015年9月28日
 */
package string;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author Alex
 *
 */
public class IsInclude {

	/**
	 * 下午8:14:37 2015年9月28日
	 * @param args
	 * @throws UnsupportedEncodingException 
	 */
	public static void main(String[] args) throws UnsupportedEncodingException {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		String strings[] = s.split("\\\\");
		scanner.close();
		System.out.println(is_include(strings[0], strings[1]));

	}
	public static boolean  is_include(String a,String b) throws UnsupportedEncodingException{
		//bytes序号越小代表高字节
	   Map<Byte,Integer> statistics=new HashMap<Byte, Integer>();
		byte []bytea=a.getBytes("gbk");
		byte []byteb=b.getBytes("gbk");
		for(int i=0;i<byteb.length;i++){
			if(isMSB1(byteb[i])){
				//如果是汉字的话
				statistics.put(new Byte(byteb[i]), numOccur(byteb, byteb[i],byteb[++i]));
			}else{
				statistics.put(new Byte(byteb[i]), numOccur(byteb, byteb[i]));
			}
		}
		for(int i=0;i<byteb.length;i++){
			if(isMSB1(byteb[i])){
				//如果是汉字的话
				statistics.put(new Byte(byteb[i]), numOccur(byteb, byteb[i],byteb[++i]));
				if(numOccur(bytea, byteb[i],byteb[++i])<statistics.get(byteb[--i])){
					i++;
					return false;
				}
				
			}else{
				if(numOccur(bytea, byteb[i])<statistics.get(byteb[i])){
					return false;
				}
			}
		}
		
		return true;
	}
	public static int numOccur(byte[] bytes,byte b){
		int num=0;
		for(int i=0;i<bytes.length;i++){
			if(bytes[i]==b){
				num++;
			}
		}
		
		
		return num;
	}
	
	public static int numOccur(byte[] bytes,byte b1,byte b2){
		int num=0;
		for(int i=0;i<bytes.length;i++){
			
				if(bytes[i]==b1 && bytes[++i]==b2)
					num++;
			
		}
		
		
		return num;
	}
	
	
	//判断最高位是不是1
	public static boolean isMSB1(byte b){	
		b>>>=8;
		if(b!=0)
		return true;
		else return false;
	}
	

}
